package project.ia04.agents.gui;

import project.ia04.utils.Data;
import jade.core.behaviours.OneShotBehaviour;
import jade.lang.acl.ACLMessage;

public class SendCoffeeBehaviour extends OneShotBehaviour {

	private String staffName;
	
	public SendCoffeeBehaviour(String staffName) {
		this.staffName = staffName;
	}

	@Override
	public void action() {
		ACLMessage message  = new ACLMessage(ACLMessage.REQUEST);
		message.setConversationId(Data.COFFEE);
		message.setContent(staffName);
		message.addReceiver(((XAgent)myAgent).getEnvAgent());
		myAgent.send(message);

		myAgent.addBehaviour(new XAgentGetCABehaviour(null));
	}

}
